<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">

          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="总结类型">
              <j-dict-select-tag  v-model="queryParam.gzzjlxid" placeholder="请选择总结类型"
                                  dictCode="zjType"  ></j-dict-select-tag>
            </a-form-item>
          </a-col>

          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <a-form-item label="教师名称">
              <a-input placeholder="请输入教师名称" v-model="queryParam.addusername"></a-input>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="11" :md="12" :sm="24">
            <a-form-item label="总结时间">
              <j-date
                placeholder="请选择开始日期"
                class="query-group-cust"
                v-model="queryParam.gzzjrq_begin"
              ></j-date>
              <span class="query-group-split-cust"></span>
              <j-date placeholder="请选择结束日期" class="query-group-cust" v-model="queryParam.gzzjrq_end"></j-date>
            </a-form-item>
          </a-col>

          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
              </a>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>


    <!-- 操作按钮区域 -->
    <div class="table-operator" :md="24" :sm="24" style="margin: 0px 0px 10px 2px">
<!--      <a-button @click="handleAdd" type="primary" icon="plus">添加</a-button>-->

      <a-button @click="searchReset" type="primary" icon="reload">刷新</a-button>

      <a-dropdown v-if="selectedRowKeys.length > 0">
        <a-menu slot="overlay">
          <a-menu-item key="1" @click="batchDel">
            <a-icon type="delete"/>
            删除
          </a-menu-item>
        </a-menu>
        <a-button style="margin-left: 8px"> 批量操作
          <a-icon type="down"/>
        </a-button>
      </a-dropdown>
    </div>

    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="checkInfo(record)" v-if="record.verifytime == null">评审</a>
          <a-divider type="vertical"/>
          <a @click="myEdit(record)">查看</a>
<!--          <a-dropdown>-->
<!--          <a class="ant-dropdown-link">-->
<!--          更多 <a-icon type="down"/>-->
<!--          </a>-->
<!--          <a-menu slot="overlay">-->
<!--          <a-menu-item>-->
<!--          <a href="javascript:;" @click="handleDetail(record)">详情</a>-->
<!--          </a-menu-item>-->

<!--          <a-menu-item>-->
<!--          <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!--          <a>删除</a>-->
<!--          </a-popconfirm>-->
<!--          </a-menu-item>-->
<!--          </a-menu>-->
<!--          </a-dropdown>-->
        </span>

      </a-table>
    </div>
    <!-- table区域-end -->

    <!-- 表单区域 -->
    <ve-jw-gzzj-modal ref="modalForm" @ok="modalFormOk"></ve-jw-gzzj-modal>
    <ve-jw-gzzj-ps-modal ref="psModalForm" @ok="modalFormOk"></ve-jw-gzzj-ps-modal>
  </a-card>
</template>

<script>
  import {EduListMixin} from '@/mixins/EduListMixin'
  import {getAction} from '@/api/manage'
  import VeJwGzzjModal from './modules/VeJwGzzjModal'
  import VeJwGzzjPsModal from './modules/VeJwGzzjPsModal'

  export default {
    name: "EduOrderTicketList",
    mixins: [EduListMixin],
    components: {
      VeJwGzzjModal,
      VeJwGzzjPsModal,
    },
    data() {
      return {
        description: 've_jw_gzzj管理页面',
        // 表头
        columns: [
          {
            title: '#',
            dataIndex: '',
            key:'rowIndex',
            width:60,
            align:"center",
            customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
          },
          {
            title:'总结类型',
            align:"center",
            dataIndex: 'gzzjlxid_dictText'
          },
          {
            title:'标题',
            align:"center",
            dataIndex: 'gzzjbt'
          },
          {
            title:'总结日期',
            align:"center",
            dataIndex: 'gzzjrq',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title:'教师名称',
            align:"center",
            dataIndex: 'addusername'
          },
          {
            title:'评审结果',
            align:"center",
            dataIndex: 'verifyresult'
          },
          {
            title:'评审人姓名',
            align:"center",
            dataIndex: 'verifyusername'
          },
          {
            title:'评审时间',
            align:"center",
            dataIndex: 'verifytime',
            customRender:function (text) {
              return !text?"":(text.length>10?text.substr(0,10):text)
            }
          },
          {
            title: '操作',
            dataIndex: 'action',
            align:"center",
            scopedSlots: { customRender: 'action' }
          }
        ],
        url: {
          list: "/teacherWork/veJwGzzj/list",
          delete: "/teacherWork/veJwGzzj/delete",
          deleteBatch: "/teacherWork/veJwGzzj/deleteBatch",
          exportXlsUrl: "/teacherWork/veJwGzzj/exportXls",
          importExcelUrl: "teacherWork/veJwGzzj/importExcel",
        },
        dictOptions:{},
        isorter: []
      }
    },
    computed: {
      importExcelUrl: function(){
        return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
      }
    },
    methods: {
      initDictConfig(){
      },

      //总结管理-评审
      checkInfo:function(record){
        this.$refs.psModalForm.edit(record);
        this.$refs.psModalForm.title="评审工作总结";
        this.$refs.psModalForm.disableSubmit=false;
      },

      //总结管理-查看
      myEdit: function (record) {
        this.$refs.modalForm.edit(record);
        this.$refs.modalForm.title = "查看工作总结";
        this.$refs.modalForm.disableSubmit = false;
      },

      review:function(record) {


      }

    }
  }
</script>
<style scoped>
  @import '~@assets/less/usercolor.less'
</style>
